#ifndef _CCONTROLBAR_H_
#define _CCONTROLBAR_H_

#include "auto.h"

#include <buola/utility/usignal.h>
#include <buola/gui/containers/clayoutcontainer.h>

namespace buola { namespace bcal {

class CControlBar : public gui::CLayoutContainer
{
public:
    CControlBar();
    ~CControlBar();

    //! sets the caption to display for the box
    void SetCaption(const std::wstring &pCaption);
    
    //! returns the caption to display for the box
    const std::wstring &GetCaption()    {   return mCaption;    }
    
//Managing fields
public:
////////////// Event handling //////////////
    virtual void OnExpose(const gui::CExposeEvent &pE);
    virtual void OnButtonDown(const gui::CMouseEvent &pE);
    virtual void OnButtonUp(const gui::CMouseEvent &pE);
    virtual void OnMouseMove(const gui::CMouseEvent &pE);
    virtual void OnSize(const gui::CGeometryEvent &pE);

    void OnViewChange(int pType);
public:
    USignal<void()> sNext;
    USignal<void()> sPrevious;
    USignal<void()> sToday;

    USignal<void(int)> sChangeView;

/////////////// protected functions //////////////

private:
    std::wstring mCaption;
    
    gui::PButton mLeftButton,mRightButton;

    gui::PButton mTodayButton;
    gui::PButton mDayButton,mWeekButton,mMonthButton;
};

/*namespace buola*/ } /*namespace bcal*/ }

#endif
